﻿using System;
using Microsoft.VisualStudio.TestTools.UnitTesting;
using System.Collections;
using System.Collections.Generic;
using Emulator.Base;
using Emulator.GameBoy;
using Emulator.GameBoy.Memory;
using Emulator.GameBoy.CPU;
using Emulator.GameBoy.CPU.Instructions;
using Emulator.GameBoyConfig;

namespace GameboyCPUALUTest
{
    [TestClass]
    public class CPUTest
    {
        GameBoyMemory mMemory = new GameBoyMemory();
        GameBoyCPU mCPU ;
        //int[] TestDataList = new int[] { 0xFF,0x7F,0};

        public CPUTest()
        {
            mCPU = new GameBoyCPU(mMemory);
            mCPU.ResetCPU();
        }

        [TestMethod]
        public void ReadMemory16Test()
        {
            mCPU.ProgramCounter = 0;
            mMemory.Write8(0x00, 0x1);
            mMemory.Write8(0x01, 0xff);
            Assert.AreEqual(0xff01, mCPU.ReadMemory16(),"ReadMemory");
            Assert.AreEqual(2, mCPU.ProgramCounter, "CPU Counter");
        }
    }
}
